#include "data_global.h"
#include "linklist.h"

extern pthread_cond_t cond_analysis;
extern pthread_cond_t cond_refresh;

extern pthread_mutex_t mutex_linklist;
extern pthread_mutex_t mutex_analysis;
extern pthread_mutex_t mutex_refresh;

pthread_t id_analysis,
		  id_transfer;

extern linklist_t linkHead, linkTail;

extern void *pthread_analysis (void *);
extern void *pthread_transfer (void *);

int main(int argc, char **argv)
{
	linkHead = linklist_create();

	pthread_mutex_init (&mutex_analysis, NULL);
	pthread_mutex_init (&mutex_refresh, NULL);
	pthread_mutex_init (&mutex_linklist, NULL); 

	pthread_cond_init (&cond_analysis, NULL);
	pthread_cond_init (&cond_refresh, NULL);

	pthread_create (&id_analysis, 0, pthread_analysis, NULL);
	pthread_create (&id_transfer, 0, pthread_transfer, NULL);

	pthread_join (id_analysis, NULL);
	pthread_join (id_transfer, NULL);
	
	return 0;
}